<style type="text/css">
    html{_overflow-y:scroll}
</style>

<form name="items" id="items" action="{$base_url}profile/modify" method="post">
<div class="pad_10">

<div id="div_setting_1" class="contentList pad-10">
<table width="100%" class="table_form">

    <tr>
        <th width="100">登录名：</th>
        <td>
            {$data.username}
        </td>
    </tr>

    <tr>
        <th width="100">重置密码：</th>
        <td>
            <input name='password' type='password' id='password' class="input-text" size='20' maxlength='20' />
        </td>
    </tr>

    <tr>
        <th width="100">真实姓名：</th>
        <td>
            <input name='nickname' type='text' id='nickname' value='{$data.nickname}' size='30' maxlength='30' />
        </td>
    </tr>

    <tr>
        <th width="100">单位名称：</th>
        <td>
            <input name='company_name' type='text' id='company_name' value='{$data.company_name}' size='30' maxlength='30'>
        </td>
    </tr>

    <tr>
        <th width="100">单位省份：</th>
        <td>
            <input name='company_province' type='text' id='company_province' value='{$data.company_province}' size='30' maxlength='30'>
        </td>
    </tr>

    <tr>
        <th width="100">单位等级：</th>
        <td>
            <input name='company_level' type='text' id='company_level' value='{$data.company_level}' size='20' maxlength='20'>
        </td>
    </tr>

    <tr>
        <th width="100">联系电话：</th>
        <td>
            <input name='company_phone' type='text' id='company_phone' value='{$data.company_phone}' size='20' maxlength='20'>
        </td>
    </tr>

    <tr>
        <th>单位详细地址：</th>
        <td>
            <input name='address' type='text' id='address' value='{$data.address}' size='40' maxlength='40'> 
        </td>
    </tr>

    <tr>
        <th>E-mail：</th>
        <td>
            <input name='email' type='text' id='email' value='{$data.email}' size='20' maxlength='20'> 
        </td>
    </tr>

</table>
</div>
    <div class="bk15"></div>
    <input type="hidden" name="user_id" value="{$data.user_id}" />
    <input type="hidden" name="username" value="{$data.username}" />
    <input name="dosubmit" type="submit" value="提交" class="button">
</form>
</div>

<!--table_form_off-->
</div>

<script type="text/javascript">
<!--
jQuery(function()
{
    jQuery.formValidator.initConfig({
        formid:"items",
        autotip:true,
        onerror:function(msg,obj) {
            window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function() {
                this.close();
                $(obj).focus();
            })
        }
    });

    // 姓名
    $("#password").formValidator({ onshow:"[可选] 请输入重置密码",onfocus:"[可选] 请输入重置密码",oncorrect:"正确"})
    .inputValidator({ min:0,onerror:"[可选] 请输入重置密码"});

    // 姓名
    $("#nickname").formValidator({ onshow:"请输入名字",onfocus:"名字必须填写",oncorrect:"正确"})
    .inputValidator({ min:1,onerror:"名字必须填写"})
    .defaultPassed();

    // 单位名称
    $("#company_name").formValidator({ onshow:"请输入单位名称",onfocus:"请输入单位名称",oncorrect:"正确"})
    .inputValidator({ min:1,onerror:"单位名称必须填写"})
    .defaultPassed();

    // 单位省份
    $("#company_province").formValidator({ onshow:"请输入单位省份",onfocus:"请输入单位省份",oncorrect:"正确"})
    .inputValidator({ min:1,onerror:"单位省份必须填写"})
    .defaultPassed();

    // 单位等级
    $("#company_level").formValidator({ onshow:"请输入单位等级，如：一、二、三医院",onfocus:"请输入单位等级，如：一、二、三医院",oncorrect:"正确"})
    .inputValidator({ min:1,onerror:"单位等级必须填写"})
    .defaultPassed();

    // 单位等级
    $("#address").formValidator({ onshow:"请输入单位详细地址",onfocus:"请输入单位详细地址",oncorrect:"正确"})
    .inputValidator({ min:1,onerror:"单位详细地址必须填写"})
    .defaultPassed();
    
    // 电话号码
    $("#company_phone").formValidator({onshow:"例如：028-38260068，手机号码请确认11位",onfocus:"电话号码格式不正确",oncorrect:"正确"})
    .regexValidator({regexp:"^(([0\\+]\\d{2,3}-)?(0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$",onerror:"电话号码格式不正确"})
    .defaultPassed();
    
    // 邮箱地址
    $("#email").formValidator({onshow:"请输入邮箱",onfocus:"邮箱格式错误",oncorrect:"正确"})
    .inputValidator({min:2,max:32,onerror:"邮箱应该为2-32位之间"})
    .regexValidator({regexp:"email",datatype:"enum",onerror:"邮箱格式错误"})
    .ajaxValidator({
        type : "get",url : "{$base_url}profile/ajax_user_field/user_id/{$data.user_id}",
        success : function(data) {
            if( data == "1") {
                return true;
            } else {
                return false;
            }
        },
        buttons: $("#dosubmit"),onerror : "禁止注册或邮箱已存在",onwait : "请稍候..."})
    .defaultPassed();

//end jQuery
});

window.top.$('#display_center_id').css('display','none');

function SwapTab(name,cls_show,cls_hide,cnt,cur)
{
    for(i=1;i<=cnt;i++) {
        if(i==cur) {
             jQuery('#div_'+name+'_'+i).show();
             jQuery('#tab_'+name+'_'+i).attr('class',cls_show);
        } else {
             jQuery('#div_'+name+'_'+i).hide();
             jQuery('#tab_'+name+'_'+i).attr('class',cls_hide);
        }
    }
}
//-->
</script>

<script type="text/javascript" src="{$asset_url}js/index/formvalidator.js"></script>
<script type="text/javascript" src="{$asset_url}js/index/formvalidatorregex.js"></script>